{extend name="public:layout" /}
{block name="title"}续保{$moudleName}{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li>
                    <i class="fa fa-hand-o-right"></i>
                    <a href="{:url('index',['mid'=>$Request.param.mid,'cid'=>$Request.param.cid])}">{$moudleName}列表</a>
                </li>
                <li class="active">车辆续保</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <input class="form-control" type="hidden" name="mid" value="13" datatype="*" />
                <input class="form-control" type="hidden" name="uid" value="{$uid}" datatype="*" />
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">保险年度</label>
                    <div class="col-sm-4">
                        <select name="safe_year" class="form-control">
                            <option name="safe_year" value="2017" {eq name="info.safe_year" value="2017"}checked{/eq}> 2017年度</option>
                            <option name="safe_year" value="2018" {eq name="info.safe_year" value="2018"}checked{/eq}> 2018年度</option>
                            <option name="safe_year" value="2019" {eq name="info.safe_year" value="2019"}checked{/eq}> 2019年度</option>
                            <option name="safe_year" value="2020" {eq name="info.safe_year" value="2020"}checked{/eq}> 2020年度</option>
                            <option name="safe_year" value="2021" {eq name="info.safe_year" value="2021"}checked{/eq}> 2021年度</option>
                            <option name="safe_year" value="2022" {eq name="info.safe_year" value="2022"}checked{/eq}> 2022年度</option>
                            <option name="safe_year" value="2023" {eq name="info.safe_year" value="2023"}checked{/eq}> 2023年度</option>
                            <option name="safe_year" value="2024" {eq name="info.safe_year" value="2024"}checked{/eq}> 2024年度</option>
                            <option name="safe_year" value="2025" {eq name="info.safe_year" value="2025"}checked{/eq}> 2025年度</option>
                            <option name="safe_year" value="" {eq name="info.safe_year" value=""}checked{/eq}> </option></select></div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">车牌号</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" placeholder="保险单" name="car_sn" value="{$info['car_sn']}" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">保险公司</label>
                    <div class="col-sm-4">
                        {:widget('common/Form/custombox',['bx_company',$info['bx_company'],'widget|common/Form/custombox|select:dict:dict_name,dict_name:type_id=201:===请选择==='])}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">经办人及联系方式</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" placeholder="" name="bx_contact" value="{$info['bx_contact']}" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">保单号码</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" placeholder="保险单" name="safe_odd" value="" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">投保种类</label>
                    <div class="col-sm-4">
                        {:widget('common/Form/custombox',['safe_type',$info['safe_type'],'widget|common/Form/custombox|select:dict:dict_name,dict_name:type_id=108'])}
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">投保金额</label>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" placeholder="投保金额" name="safe_money" value="" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">投保时间</label>
                    <div class="col-sm-4">
                        <input class="form-control laydatetime" type="text" placeholder="投保时间" name="safe_time" value="{$info['safe_endtime']}" />
                    </div>
                    <script>formatDate();</script>
                    <label class="col-sm-2 control-label Validform_label">到期时间</label>
                    <div class="col-sm-4">
                        <input class="form-control laydatetime" type="text" placeholder="到期时间" name="safe_endtime" value="" />
                    </div>
                    <script>formatDate();</script>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">保单原件</label>
                    <div class="col-sm-10">
                        {:widget('common/Form/moreImg',['safe_images','',$uid])}
                    </div>
                </div>
                <div class="form-group" style="display:none">
                    <label class="col-sm-2 control-label Validform_label">排序</label>
                    <div class="col-sm-3">
                        <input class="form-control" type="text" placeholder="" name="sort" value="{$info['sort']}" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" id="btnSub" type="button">保存</button>
                        <a href="{:url('index',['mid'=>$Request.param.mid])}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        formatDate();
        In('layer',function () {
            $('#btnSub').click(function () {
                $.post("{:url('logic.query/addSafe')}",$('#form').serialize(),function (res) {
                    if(res.code==1){
                        layer.msg(res.msg,{time:800},function () {
                            back();
                        })
                    }else{
                        layer.msg(res.msg,{time:1000});
                    }
                })
            })
        })
    });
</script>
{/block}